﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileTree.aspx.cs" Inherits="RichECMS.ServerPages.CoderEditor.FileTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Source/Commoncss.css" rel="stylesheet" type="text/css" />
    <link href="../../sysCommon/sysScripts/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"
        type="text/css" />
    <link href="../../sysCommon/sysScripts/ztree/css/Filetree.css" rel="stylesheet" type="text/css" />
    <script src="../../sysCommon/sysScripts/jquery/1.7.2/Jquery.js" type="text/javascript"></script>
    <script src="../../sysCommon/sysScripts/ztree/js/jquery.ztree.all-3.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
		<!--
        var setting = {
            data: {
                simpleData: {
                    enable: true
                }
            },
            callback: {
                //beforeClick: beforeClick,
                onClick: onClick
            }
        };

        var zNodes = <% =BuildTree() %>;

        function onClick(event, treeId, treeNode, clickFlag) {
            //console.dir(treeNode);
            if (treeNode.lifetype == "file") {
                var info = "";
                info += "<span class='infotitle'>文件名称：</span>" + treeNode.name + "<br />";
                info += "<span class='infotitle'>文件类型：</span>" + treeNode.filetype + "<br />";
                info += "<span class='infotitle'>文件大小：</span>" + treeNode.size + "<br />";
                info += "<span class='infotitle'>创建时间：</span>" + treeNode.creattime + "<br />";
                info += "<span class='infotitle'>修改时间：</span>" + treeNode.lastwritetime + "<br />";
                $(".fileInfo").html(info);
                var href = "CodeEditor.aspx?filepath=" + escape(treeNode.filepath);
                window.parent.changeframelink(href,treeNode.name);
            }
        }

        $(document).ready(function () {
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
		//-->
    </script>
    <style type="text/css">
        body
        {
            height: 400px;
        }
        .zTreeDemoBackground
        {
            height: 300px;
            overflow: auto;
            margin: 10px 0px 10px 0px;
        }
        .zTreeDemoBackgroundparent
        {
            border: 1px solid #ccc;
        }
        .infotitle
        {color:#b18859;}
        .fileInfo
        {padding:10px 0px 0px 10px;}
    </style>
</head>
<body style="padding-top:0px;margin-top:0px;">
    <form id="form1" runat="server">
    <div>
        <div class="zTreeDemoBackgroundparent">
            <div class="zTreeDemoBackground left">
                <ul id="treeDemo" class="ztree">
                </ul>
            </div>
        </div>
        <div class="fileInfo">
        </div>
    </div>
    </form>
</body>
</html>
